package utils;

import java.lang.reflect.*;

public class AniReflectUtils{

	public static Object callStaticMethod(
			String classPath,
			String methodName,
			Object[] params) throws Exception{
		Class controllerClass=Class.forName(classPath);
		Method oneMethod=controllerClass.getMethod(methodName);
		return oneMethod.invoke(params);
	}
	public static Object callMethod(Object oneObject, String objectClassName, String methodName) throws Exception{
		Class oneClass=Class.forName(objectClassName);
		Method oneMethod=oneClass.getMethod(methodName);
		return oneMethod.invoke(oneObject, null);
	}
	public static Object getStaticField(
			String classPath,
			String fieldName) throws Exception{
		Class controllerClass=Class.forName(classPath);
		Field oneField = controllerClass.getField(fieldName);
		return oneField.get(null);
		
	}
}
